package com.game.server.message.proto.execute;

import com.comm.ISession;

import com.game.majiang.logic.LogicClient;
import com.game.majiang.logic.LogicPlayer;
import com.game.majiang.logic.LogicServer;
import com.game.majiang.logic.chexuan.ChexuanTabale;
import com.game.server.message.proto.in.AbstractOperationReq;
import com.game.server.system.AbstractPlayer;
import com.game.server.system.AbstractTable;

public class OperationReq extends AbstractOperationReq {

    @Override
    public void Execute(ISession session) {
        LogicClient client = (LogicClient) LogicServer.getInstance().getClient(session.getId());
        if (client != null&&client.checkClick(msgcode)) {
           AbstractTable abTable = client.getTable();
           if(abTable != null) {
        	   ChexuanTabale table = (ChexuanTabale) abTable;
        	   LogicPlayer player = (LogicPlayer) table.getPlayer(client.getUserId());
        	   player.setAutoOperateCount(0);
        	   table.gameOperate(client, this.operation, this.chip);
           }
        }
    }

}
